package com.rpframework.module.common.bottom.api.baidu.com;

import com.rpframework.core.json.ParameterException;
import com.rpframework.module.common.bottom.api.juhe.cn.Position;
import org.apache.commons.lang3.StringUtils;

/**
 * JSON:
 * {
 * status: 0,
 * result: {
 * location: {
 * lng: 104.04700999999996,
 * lat: 30.548396905160846
 * },
 * formatted_address: "四川省成都市武侯区天府四街",
 * business: "",
 * addressComponent: {
 * adcode: "510107",
 * city: "成都市",
 * country: "中国",
 * direction: "",
 * distance: "",
 * district: "武侯区",
 * province: "四川省",
 * street: "天府四街",
 * street_number: "",
 * country_code: 0
 * },
 * pois: [ ],
 * poiRegions: [ ],
 * sematic_description: "保利心语花园西144米",
 * cityCode: 75
 * }
 * }
 * Created by jump on 2016/8/29.
 */
public class JsonMap extends Position {
    /**
     * 检测地址是否存在
     * @param map 地址
     */
    public static void check(Position map) {
        if (StringUtils.isBlank(map.getAddressComponent().getCity())) throw new ParameterException("此地址未找到");

    }
}
